package com.example.musicwebcon.model.dto;

import com.example.musicwebcon.model.User;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

public class UserInfoDTO {
    @Length(max = 10, message = "用户ID长度不能超过10个字符")
    private String infoId; // Corresponds to user table's user_id

    @NotBlank(message = "昵称不能为空")
    @Length(max = 50, message = "昵称长度不能超过50个字符")
    private String nickname;

    private User.Gender gender;

    @Length(max = 255, message = "签名长度不能超过255个字符")
    private String signature;

    @Length(max = 50, message = "生日长度不能超过50个字符")
    private String birthday;

    @Length(max = 8000, message = "头像URL长度不能超过255个字符")
    private String avatar;



    public UserInfoDTO() {
        this.signature="无";
        this.birthday="1990-01-01";
    }

    // 构造器
    public UserInfoDTO(String infoId, String nickname, User.Gender gender, String signature, String birthday, String avatar) {
        this.infoId = infoId;
        this.nickname = nickname;
        this.gender = gender;
        this.signature = signature;
        this.birthday = birthday;
        this.avatar = avatar;
    }

    // Getter 和 Setter 方法
    public String getInfoId() {
        return infoId;
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public User.Gender getGender() {
        return gender;
    }

    public void setGender(User.Gender gender) {
        this.gender = gender;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }



    @Override
    public String toString() {
        return "UserInfoDTO{" +
                "infoId='" + infoId + '\'' +
                ", nickname='" + nickname + '\'' +
                ", gender='" + gender + '\'' +
                ", signature='" + signature + '\'' +
                ", birthday='" + birthday + '\'' +
                ", avatar='" + avatar + '\'' +
                '}';
    }
}

